﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using ClassLibrary1;

namespace WCFClient
{
    class Program
    {
        static void Main(string[] args)
        {
            WSHttpBinding binding = new WSHttpBinding();
            EndpointAddress remoteAddress = new EndpointAddress("http://localhost:8090/MyService/HelloWCFService");

            HelloWCFClient client = new HelloWCFClient(binding, remoteAddress);

            string result = client.HelloWCF();

            client.Close();

            Console.WriteLine(result);
            Console.ReadLine();  
        }
    }


   


    public class HelloWCFClient : ClientBase<IHelloWCF>, IHelloWCF
    {
        public HelloWCFClient(System.ServiceModel.Channels.Binding binding, EndpointAddress remoteAddress)
            : base(binding, remoteAddress)
        {

        }

        public HelloWCFClient()
            : base()
        {

        }

        public string HelloWCF()
        {
            return base.Channel.HelloWCF();
        }  
    }  
  

}
